package com.xunlai.infra.permission.business.converter;

import com.xunlai.infra.permission.business.dao.entity.Poster;
import com.xunlai.infra.permission.business.dao.entity.PosterFavorite;
import com.xunlai.infra.permission.business.dao.entity.PosterTemplate;
import com.xunlai.infra.permission.business.dao.entity.PosterType;
import com.xunlai.infra.permission.business.vo.poster.PosterCreateVo;
import com.xunlai.infra.permission.business.vo.poster.PosterDetailVo;
import com.xunlai.infra.permission.business.vo.poster.PosterFavoriteCreateVo;
import com.xunlai.infra.permission.business.vo.poster.PosterListVo;
import com.xunlai.infra.permission.business.vo.poster.PosterTemplateCreateVo;
import com.xunlai.infra.permission.business.vo.poster.PosterTemplateListVo;
import com.xunlai.infra.permission.business.vo.poster.PosterTemplateVo;
import com.xunlai.infra.permission.business.vo.poster.PosterTypeCreateVo;
import com.xunlai.infra.permission.business.vo.poster.PosterTypeListVo;
import com.xunlai.infra.permission.business.vo.poster.PosterTypeQueryVo;
import javax.annotation.processing.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-02-21T19:24:58+0800",
    comments = "version: 1.5.3.Final, compiler: javac, environment: Java 17.0.5 (Amazon.com Inc.)"
)
public class PosterConverterImpl implements PosterConverter {

    @Override
    public PosterTemplate convertCreateVo2TemplateEntity(PosterTemplateCreateVo posterTemplateCreateVo) {
        if ( posterTemplateCreateVo == null ) {
            return null;
        }

        PosterTemplate.PosterTemplateBuilder posterTemplate = PosterTemplate.builder();

        posterTemplate.posterName( posterTemplateCreateVo.getPosterName() );
        posterTemplate.posterContent( posterTemplateCreateVo.getPosterContent() );
        posterTemplate.posterContentUri( posterTemplateCreateVo.getPosterContentUri() );
        posterTemplate.posterType( posterTemplateCreateVo.getPosterType() );
        posterTemplate.typeName( posterTemplateCreateVo.getTypeName() );
        posterTemplate.posterImg( posterTemplateCreateVo.getPosterImg() );
        posterTemplate.posterTemplateNo( posterTemplateCreateVo.getPosterTemplateNo() );
        posterTemplate.paid( posterTemplateCreateVo.getPaid() );

        return posterTemplate.build();
    }

    @Override
    public Poster convertCreateVo2PosterEntity(PosterCreateVo posterCreateVo) {
        if ( posterCreateVo == null ) {
            return null;
        }

        Poster.PosterBuilder poster = Poster.builder();

        poster.posterName( posterCreateVo.getPosterName() );
        poster.posterContent( posterCreateVo.getPosterContent() );
        poster.posterContentUri( posterCreateVo.getPosterContentUri() );
        poster.posterType( posterCreateVo.getPosterType() );
        poster.typeName( posterCreateVo.getTypeName() );
        poster.posterImg( posterCreateVo.getPosterImg() );
        poster.posterTemplate( posterCreateVo.getPosterTemplate() );
        poster.posterNo( posterCreateVo.getPosterNo() );

        return poster.build();
    }

    @Override
    public PosterFavorite convertCreateVo2FavoriteEntity(PosterFavoriteCreateVo posterFavoriteCreateVo) {
        if ( posterFavoriteCreateVo == null ) {
            return null;
        }

        PosterFavorite.PosterFavoriteBuilder posterFavorite = PosterFavorite.builder();

        posterFavorite.posterId( posterFavoriteCreateVo.getPosterId() );
        posterFavorite.posterType( posterFavoriteCreateVo.getPosterType() );
        posterFavorite.posterTitle( posterFavoriteCreateVo.getPosterTitle() );

        return posterFavorite.build();
    }

    @Override
    public PosterType convertCreateVo2PosterTypeEntity(PosterTypeCreateVo routeTypeCreateVo) {
        if ( routeTypeCreateVo == null ) {
            return null;
        }

        PosterType.PosterTypeBuilder posterType = PosterType.builder();

        posterType.typeName( routeTypeCreateVo.getTypeName() );

        return posterType.build();
    }

    @Override
    public PosterTypeListVo convertPosterTypeEntity2ListVo(PosterType routeType) {
        if ( routeType == null ) {
            return null;
        }

        PosterTypeListVo.PosterTypeListVoBuilder posterTypeListVo = PosterTypeListVo.builder();

        posterTypeListVo.id( routeType.getId() );
        posterTypeListVo.typeName( routeType.getTypeName() );
        posterTypeListVo.createUser( routeType.getCreateUser() );
        posterTypeListVo.createTime( routeType.getCreateTime() );

        return posterTypeListVo.build();
    }

    @Override
    public PosterType convertQueryVo2PosterTypeEntity(PosterTypeQueryVo routeTypeQueryVo) {
        if ( routeTypeQueryVo == null ) {
            return null;
        }

        PosterType.PosterTypeBuilder posterType = PosterType.builder();

        posterType.typeName( routeTypeQueryVo.getTypeName() );

        return posterType.build();
    }

    @Override
    public PosterTemplateListVo convertEntity2ListVo(PosterTemplate posterTemplate) {
        if ( posterTemplate == null ) {
            return null;
        }

        PosterTemplateListVo.PosterTemplateListVoBuilder posterTemplateListVo = PosterTemplateListVo.builder();

        posterTemplateListVo.id( posterTemplate.getId() );
        posterTemplateListVo.posterName( posterTemplate.getPosterName() );
        posterTemplateListVo.posterContentUri( posterTemplate.getPosterContentUri() );
        posterTemplateListVo.posterType( posterTemplate.getPosterType() );
        posterTemplateListVo.typeName( posterTemplate.getTypeName() );
        posterTemplateListVo.posterImg( posterTemplate.getPosterImg() );
        posterTemplateListVo.createUser( posterTemplate.getCreateUser() );
        posterTemplateListVo.createTime( posterTemplate.getCreateTime() );
        posterTemplateListVo.posterTemplateNo( posterTemplate.getPosterTemplateNo() );
        posterTemplateListVo.paid( posterTemplate.getPaid() );

        return posterTemplateListVo.build();
    }

    @Override
    public PosterListVo convertPosterEntity2ListVo(Poster poster) {
        if ( poster == null ) {
            return null;
        }

        PosterListVo.PosterListVoBuilder posterListVo = PosterListVo.builder();

        posterListVo.id( poster.getId() );
        posterListVo.posterName( poster.getPosterName() );
        posterListVo.posterContent( poster.getPosterContent() );
        posterListVo.posterContentUri( poster.getPosterContentUri() );
        posterListVo.posterType( poster.getPosterType() );
        posterListVo.typeName( poster.getTypeName() );
        posterListVo.posterImg( poster.getPosterImg() );
        posterListVo.createUser( poster.getCreateUser() );
        posterListVo.posterTemplate( poster.getPosterTemplate() );
        posterListVo.posterNo( poster.getPosterNo() );
        posterListVo.createTime( poster.getCreateTime() );

        return posterListVo.build();
    }

    @Override
    public PosterTemplateVo convertTemplateEntity2Vo(PosterTemplate posterTemplate) {
        if ( posterTemplate == null ) {
            return null;
        }

        PosterTemplateVo.PosterTemplateVoBuilder posterTemplateVo = PosterTemplateVo.builder();

        posterTemplateVo.id( posterTemplate.getId() );
        posterTemplateVo.posterName( posterTemplate.getPosterName() );
        posterTemplateVo.posterContent( posterTemplate.getPosterContent() );
        posterTemplateVo.posterContentUri( posterTemplate.getPosterContentUri() );
        posterTemplateVo.posterType( posterTemplate.getPosterType() );
        posterTemplateVo.typeName( posterTemplate.getTypeName() );
        posterTemplateVo.posterImg( posterTemplate.getPosterImg() );
        posterTemplateVo.posterTemplateNo( posterTemplate.getPosterTemplateNo() );
        posterTemplateVo.createUser( posterTemplate.getCreateUser() );
        posterTemplateVo.createTime( posterTemplate.getCreateTime() );

        return posterTemplateVo.build();
    }

    @Override
    public PosterDetailVo convertPosterEntity2DetailVo(Poster poster) {
        if ( poster == null ) {
            return null;
        }

        PosterDetailVo.PosterDetailVoBuilder posterDetailVo = PosterDetailVo.builder();

        posterDetailVo.id( poster.getId() );
        posterDetailVo.posterName( poster.getPosterName() );
        posterDetailVo.posterContent( poster.getPosterContent() );
        posterDetailVo.posterContentUri( poster.getPosterContentUri() );
        posterDetailVo.posterType( poster.getPosterType() );
        posterDetailVo.typeName( poster.getTypeName() );
        posterDetailVo.posterImg( poster.getPosterImg() );
        posterDetailVo.posterTemplate( poster.getPosterTemplate() );
        posterDetailVo.createUser( poster.getCreateUser() );
        posterDetailVo.posterNo( poster.getPosterNo() );
        posterDetailVo.createTime( poster.getCreateTime() );

        return posterDetailVo.build();
    }
}
